import config from "@/config"
import http from "@/utils/request"

export default {
    list: {
        url: `${config.API_URL}/adminapi/production.ProductionOrder/lists`,
        name: "获取生产单列表",
        get: async function(data={}){
            return await http.get(this.url, data);
        }
    },
    add: {
        url: `${config.API_URL}/adminapi/production.ProductionOrder/add`,
        name: "添加生产单",
        post: async function(data={}){
            return await http.post(this.url, data);
        }
    },
    edit: {
        url: `${config.API_URL}/adminapi/production.ProductionOrder/edit`,
        name: "修改生产单",
        post: async function(data={}){
            return await http.post(this.url, data);
        }
    },
    delete: {
        url: `${config.API_URL}/adminapi/production.ProductionOrder/delete`,
        name: "删除生产单",
        post: async function(data={}){
            return await http.post(this.url, data);
        }
    },
    detail: {
        url: `${config.API_URL}/adminapi/production.ProductionOrder/detail`,
        name: "生产单详情",
        get: async function(params){
            return await http.get(this.url, params);
        }
    },
    // 计划入库
    inhouse:{
        list: {
            url: `${config.API_URL}/adminapi/production.ProductionEntry/lists`,
            name: "获取入库列表",
            get: async function(data={}){
                return await http.get(this.url, data);
            }
        },
        add: {
            url: `${config.API_URL}/adminapi/production.ProductionEntry/add`,
            name: "添加入库",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        edit: {
            url: `${config.API_URL}/adminapi/production.ProductionEntry/edit`,
            name: "修改入库",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        delete: {
            url: `${config.API_URL}/adminapi/production.ProductionEntry/delete`,
            name: "删除入库",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        detail: {
            url: `${config.API_URL}/adminapi/production.ProductionEntry/detail`,
            name: "入库详情",
            get: async function(params){
                return await http.get(this.url, params);
            }
        },
        check: {
            url: `${config.API_URL}/adminapi/production.ProductionEntry/checkStatus`,
            name: "入库审核",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        uncheck: {
            url: `${config.API_URL}/adminapi/production.ProductionEntry/uncheckStatus`,
            name: "入库反审核",
            get: async function(params){
                return await http.get(this.url, params);
            }
        },
    },
    // 计划发货
    send:{
        list: {
            url: `${config.API_URL}/adminapi/production.ProductionDeliver/lists`,
            name: "获取发货列表",
            get: async function(data={}){
                return await http.get(this.url, data);
            }
        },
        add: {
            url: `${config.API_URL}/adminapi/production.ProductionDeliver/add`,
            name: "添加发货",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        edit: {
            url: `${config.API_URL}/adminapi/production.ProductionDeliver/edit`,
            name: "修改发货",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        delete: {
            url: `${config.API_URL}/adminapi/production.ProductionDeliver/delete`,
            name: "删除发货",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        detail: {
            url: `${config.API_URL}/adminapi/production.ProductionDeliver/detail`,
            name: "发货详情",
            get: async function(params){
                return await http.get(this.url, params);
            }
        },
        check: {
            url: `${config.API_URL}/adminapi/production.ProductionDeliver/checkStatus`,
            name: "发货审核",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        uncheck: {
            url: `${config.API_URL}/adminapi/production.ProductionDeliver/uncheckStatus`,
            name: "发货反审核",
            get: async function(params){
                return await http.get(this.url, params);
            }
        },
    },
    // 生产任务管理
    plan:{
        list: {
            url: `${config.API_URL}/adminapi/production.ProductionPlan/lists`,
            name: "获取生产任务列表",
            get: async function(data={}){
                return await http.get(this.url, data);
            }
        },
        shoplist: {
            url: `${config.API_URL}/adminapi/production.ProductionPlan/itemLists`,
            name: "生产任务 -- 商品列表",
            get: async function(params){
                return await http.get(this.url, params);
            }
        },
        add: {
            url: `${config.API_URL}/adminapi/production.ProductionPlan/add`,
            name: "添加生产任务",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        edit: {
            url: `${config.API_URL}/adminapi/production.ProductionPlan/edit`,
            name: "修改生产任务",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        delete: {
            url: `${config.API_URL}/adminapi/production.ProductionPlan/delete`,
            name: "删除生产任务",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        invalid: {
            url: `${config.API_URL}/adminapi/production.ProductionPlan/invalid`,
            name: "作废生产任务",
            get: async function(data={}){
                return await http.get(this.url, data);
            }
        },
        detail: {
            url: `${config.API_URL}/adminapi/production.ProductionPlan/detail`,
            name: "生产任务详情",
            get: async function(params){
                return await http.get(this.url, params);
            }
        },
        check: {
            url: `${config.API_URL}/adminapi/production.ProductionPlan/checkStatus`,
            name: "生产任务审核",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        uncheck: {
            url: `${config.API_URL}/adminapi/production.ProductionPlan/uncheckStatus`,
            name: "生产任务反审核",
            get: async function(params){
                return await http.get(this.url, params);
            }
        },
        mater:{
            url: `${config.API_URL}/adminapi/production.ProductionPlan/getPlanProductsMaterial`,
			name: "报料单",
			get: async function(data={}){
				return await http.get(this.url, data);
			}
        },
        materExport:{
            url: `${config.API_URL}/adminapi/production.ProductionPlan/exportPlanProductsMaterial`,
			name: "报料单导出",
			get: async function(data={}){
				return await http.get(this.url, data);
			}
        },
        print:{
            url: `${config.API_URL}/adminapi/production.ProductionPlan/printLabel`,
			name: "打印标签",
			get: async function(data={}){
				return await http.get(this.url, data);
			}
        },
        del_detail: {
            url: `${config.API_URL}/adminapi/production.ProductionPlan/del_detail`,
            name: "删除生产任务明细",
            get: async function(data={}){
                return await http.get(this.url, data);
            }
        },
    },
    // 装配
    assembly:{
        list: {
            url: `${config.API_URL}/adminapi/product.assembly/lists`,
            name: "获取装配列表",
            get: async function(data={}){
                return await http.get(this.url, data);
            }
        },
        add: {
            url: `${config.API_URL}/adminapi/product.assembly/add`,
            name: "添加装配",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        edit: {
            url: `${config.API_URL}/adminapi/product.assembly/edit`,
            name: "修改装配",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        delete: {
            url: `${config.API_URL}/adminapi/product.assembly/delete`,
            name: "删除装配",
            get: async function(data={}){
                return await http.get(this.url, data);
            }
        },
        detail: {
            url: `${config.API_URL}/adminapi/product.assembly/detail`,
            name: "装配详情",
            get: async function(data){
                return await http.get(this.url, data);
            }
        },
        over: {
            url: `${config.API_URL}/adminapi/product.assembly/complete`,
            name: "完成装配",
            get: async function(data){
                return await http.get(this.url, data);
            }
        },
        shortage: {
            url: `${config.API_URL}/adminapi/product.assembly/materialShortage`,
            name: "缺料",
            get: async function(data){
                return await http.get(this.url, data);
            }
        },
        edithole: {
            url: `${config.API_URL}/adminapi/product.assembly/editHole`,
            name: "编辑孔",
            get: async function(data){
                return await http.get(this.url, data);
            }
        },
    },
    // 包装
    package:{
        list: {
            url: `${config.API_URL}/adminapi/product.packaging/lists`,
            name: "获取包装列表",
            get: async function(data={}){
                return await http.get(this.url, data);
            }
        },
        over: {
            url: `${config.API_URL}/adminapi/product.packaging/complete`,
            name: "完成包装",
            get: async function(data){
                return await http.get(this.url, data);
            }
        },
        cheer: {
            url: `${config.API_URL}/adminapi/product.packaging/cheer`,
            name: "加油",
            get: async function(data){
                return await http.get(this.url, data);
            }
        },
        edithole: {
            url: `${config.API_URL}/adminapi/product.packaging/editHole`,
            name: "编辑孔",
            get: async function(data){
                return await http.get(this.url, data);
            }
        },
    },
}
